/**
 *
 */
package com.angel.email.account.impl;

import com.angel.common.helpers.StringHelper;
import com.angel.email.account.AccountInformation;

/**
 * @author William
 * @since 12/August/2009
 *
 */
public class MockAccountInformation implements AccountInformation {

	private String emailAccount;
	private String passwordAccount;
	private String name;

	public MockAccountInformation(String emailAccount, String passwordAccount, String name){
		this(emailAccount, passwordAccount);
		this.name = name;
	}
	
	public MockAccountInformation(String emailAccount, String passwordAccount){
		super();
		this.emailAccount = emailAccount;
		this.passwordAccount = passwordAccount;
		this.name = StringHelper.containsAtLeast(emailAccount, "@")? emailAccount.substring(0, emailAccount.indexOf("@")): emailAccount;
	}

	/* (non-Javadoc)
	 * @see com.angel.email.account.AccountInformation#getEmailAccount()
	 */
	public String getEmailAccount() {
		return this.emailAccount;
	}

	/* (non-Javadoc)
	 * @see com.angel.email.account.AccountInformation#getPasswordAccount()
	 */
	public String getPasswordAccount() {
		return this.passwordAccount;
	}

	/* (non-Javadoc)
	 * @see com.angel.email.account.AccountInformation#getName()
	 */
	public String getName() {
		return this.name;
	}

}
